package xx.rabbitmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import xx.rabbitmq.conf.BackConfig;

@Slf4j
@Component
public class WarningReceiver {
    /**
     * 接收报警信息
     * @param message
     */
    @RabbitListener(queues = BackConfig.WARN_QUEUE)
    public void receiveWarningMsg(Message message) {
        String msg = new String(message.getBody());
        log.error("报警发现不可路由消息:{}", msg);
    }
}
